package com.gree.fms.processor.convertors;

import com.gree.fms.processor.interfaces.IExpand;

public class ClassInstanceConvertor {

    public static Object instanceInit(String classPath, String customize, String tableKey) {
        try {
            Class<?> claxx = Class.forName(classPath);
            Object instance = claxx.newInstance();
            if (IExpand.class.isAssignableFrom(instance.getClass())) {
                IExpand expandInstance = (IExpand)instance;
                expandInstance.customize(customize);
                expandInstance.tableKey(tableKey);
            }
            return instance;
        } catch (Exception err) {
            return null;
        }
    }

    public static void main(String[] args) {

    }
}
